import java.util.Scanner;

public class PayroolSystem
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        Employee[] emps = new Employee[2];

        emps[0] = new SalariedEmployee("张三", 1001,
                new MyDate(2004, 10, 27), 9999);

        emps[1] = new HourlyEmployee("李四", 1002,
                new MyDate(2003, 4, 12), 200, 100);

        for (int i = 0; i < emps.length; i++)
        {
            System.out.println(emps[i].toString());
            System.out.println(emps[i].earnings());
        }

        int month = 0, day = 0;

        System.out.println("输入当前日期：");

        month = in.nextInt();
        day = in.nextInt();

        for (int i = 0; i < emps.length; i++)
        {
            if (month == emps[i].getBirthday().getMonth() && day == emps[i].getBirthday().getDay())
            {
                System.out.println(emps[i].getName() + "生日快乐");
            }
        }
    }
}
